Technical Q&As

QTW 82 - MCIsPlayerMessage() Usage with MFC (27-September-96)


Q We are writing a 32-bit Windows program in MFC 4.0 to play QuickTime audio from a .mov file. We are linking in the QT 2.1 library. If we call MCIsPlayerMessage() in the method PreTranslateMessage() that is derived from the class WinApp, we only hear the first one second of audio (independent of how long we tell it to play). I think that this is because we are not giving processing time to QT; MCIsPlayerMessage() never returns TRUE.

If we issue the command MCDoAction(myAudioController, mcActionIdle, NULL), instead, the audio plays, but we clip the last 20 frames.

MCIsPlayerMessage() works just fine in our Win 3.1 program in WinProc. Is there something special about MFC 4.0? Are we putting the call in the rightplace?


A The QuickTime for Windows "heartbeat" message does not get passed to PreTranslateMessage(). For this reason, the correct method is to subclass CWnd::WindowProc and place the MCIsPlayerMessage() function call there. This will play the movie much better than trying to call MCIdle() repeatedly.

 



Technical Q &A's;
Previous Question | Contents | Next Question